package r5.pierwszy.raz;

public class Manager extends Employee {

	private double bonus;

	public Manager(String name, double salary, int year, int month, int day) {
		super(name, salary, year, month, day);
		bonus = 0;
	}

	public double getBonus() {
		return bonus;
	}

	@Override
	public String toString() {
		return super.toString() + "[bonus = " + this.bonus + "]";
	}

	@Override
	public boolean equals(Object o) {
		if (!super.equals(o))
			return false;
		Manager m = (Manager) o;
		return this.bonus == m.getBonus();
	}

	@Override
	public Manager getBuddy() {
		return this;
	}

	@Override
	public double getSalary() {
		return super.getSalary() + bonus;
	}

	public void setBonus(double bonus) {
		this.bonus = bonus;
	}
}
